package claybird.dom;

import javax.persistence.Entity;
import javax.persistence.ManyToOne;

/*
 * Result of the day for a shooter.
 */
@Entity
public class Result  extends BaseEntity{
	//
	//
	//PARAMETERS
	//
	//

	@ManyToOne
	private Person person;
	@ManyToOne
	private ShootDay shootDay;
	private Byte numberOfClayShooted=0;
	private Byte numberOfClayTotal=0;
	private float realValue=0;
	private Short ranking=0;
	private Short rankingWithGuest=0;
	private float percentNewHandicap=0;
	private float evolution=0;

    private Handicap.Categorie lastCategorieOfHandicap = Handicap.Categorie.candidat;
	public Result(){
		
	}
	
	public Result(ShootDay day, Person pers) {
		this.numberOfClayTotal=day.getNumberOfClay();
		this.shootDay =day;
		this.setPerson(pers);
	}

	//
	//
	// GETTER & SETTER
	//
	//
	public ShootDay getShootDay() {
		return shootDay;
	}
	public void setShootDay(ShootDay shootDay) {
		this.shootDay = shootDay;
	}
	public Byte getNumberOfClayShooted() {
		return numberOfClayShooted;
	}
	public void setNumberOfClayShooted(Byte numberOfClayShooted) {
		this.numberOfClayShooted = numberOfClayShooted;
	}
	public Byte getNumberOfClayTotal() {
		return numberOfClayTotal;
	}
	public void setNumberOfClayTotal(Byte numberOfClayTotal) {
		this.numberOfClayTotal = numberOfClayTotal;
	}
	public Short getRanking() {
		return ranking;
	}
	public void setRanking(Short ranking) {
		this.ranking = ranking;
	}
	public Short getRankingWithGuest() {
		return rankingWithGuest;
	}
	public void setRankingWithGuest(Short rankingWithGuest) {
		this.rankingWithGuest = rankingWithGuest;
	}
	public float getPercentNewHandicap() {
		return percentNewHandicap;
	}
	public void setPercentNewHandicap(float percentNewHandicap) {
		this.percentNewHandicap = percentNewHandicap;
	}

	public float getEvolution() {
		return evolution;
	}

	public void setEvolution(float evolution) {
		this.evolution = evolution;
	}

	public Person getPerson() {
		return person;
	}

	public void setPerson(Person person) {
		this.person = person;
		this.lastCategorieOfHandicap=person.getLastHandicap().getCategorie();
	}

	public float getRealValue() {
		return realValue;
	}

	public void setRealValue(float realValue) {
		this.realValue = realValue;
	}

	public Handicap.Categorie getLastCategorieOfHandicap() {
		return lastCategorieOfHandicap;
	}

	public void setLastCategorieOfHandicap(Handicap.Categorie lastCategorieOfHandicap) {
		this.lastCategorieOfHandicap = lastCategorieOfHandicap;
	}

	
}
